﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HRM.Entity;

namespace HRM.DAL
{
    public class DepartmentDAL: BaseDAL
    {
        public List<Department> GetAll()
        {
            return Repository.All<Department>().ToList();
        }

        public Department GetByID(int ID)
        {
            return Repository.Single<Department>(dep => dep.ID == ID);
        }

        public Department Add(Department item)
        {
            Repository.Add<Department>(item);
            return item;
        }

        public Department Update(Department item)
        {
            Repository.Update<Department>(item);
            return item;
        }

        public void Delete(int ID)
        {
            Repository.Delete<Department>(ID);
        }
    }
}
